package com.jack006.api.controller.user;

import com.jack006.grace.result.GraceJSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Classname MyFansControllerApi
 * @Description 粉丝管理相关的接口定义
 * @Date 2021-06-10 08:15
 * @Created by jack
 */
@Api(value = "粉丝管理",tags = "粉丝管理定义功能的 Controller")
@RequestMapping("fans")
public interface MyFansControllerApi {

    @ApiOperation(value = "被动更新粉丝用户信息", notes = "被动更新粉丝用户信息", httpMethod = "POST")
    @PostMapping("/forceUpdateFanInfo")
    public GraceJSONResult forceUpdateFanInfo(@RequestParam String relationId,
                                              @RequestParam String fanId);


    @ApiOperation(value = "查询当前用户是否关注过作家",notes = "查询当前用户是否关注过作家",httpMethod = "POST")
    @PostMapping("/isMeFollowThisWriter")
    GraceJSONResult isMeFollowThisWriter(@RequestParam("writerId") String writerId,
                                         @RequestParam("fanId") String fanId);

    @ApiOperation(value = "用户关注作家，成为粉丝",notes = "用户关注作家，成为粉丝",httpMethod = "POST")
    @PostMapping("/follow")
    GraceJSONResult follow(@RequestParam("writerId") String writerId,
                           @RequestParam("fanId") String fanId);

    @ApiOperation(value = "取消关注，作家损失粉丝",notes = "取消关注，作家损失粉丝",httpMethod = "POST")
    @PostMapping("/unfollow")
    GraceJSONResult unfollow(@RequestParam("writerId") String writerId,
                             @RequestParam("fanId") String fanId);

    @ApiOperation(value = "查询粉丝列表",notes = "查询粉丝列表",httpMethod = "POST")
    @PostMapping("/queryAll")
    GraceJSONResult queryAll(
                            @RequestParam("writerId") String writerId,
                            @ApiParam(name = "page",value = "查询下一页的第几页",required = false)
                            @RequestParam("page") Integer page,
                            @ApiParam(name = "pageSize",value = "分页查询每一页显示的条数",required = false)
                            @RequestParam("pageSize") Integer pageSize);


    @ApiOperation(value = "查询男女粉丝数量",notes = "查询男女粉丝数量",httpMethod = "POST")
    @PostMapping("/queryRatio")
    GraceJSONResult queryRatio(@RequestParam("writerId") String writerId);

    @ApiOperation(value = "根据地域查询粉丝数量",notes = "根据地域查询粉丝数量",httpMethod = "POST")
    @PostMapping("/queryRatioByRegion")
    GraceJSONResult queryRatioByRegion(@RequestParam("writerId") String writerId);

}
